home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 May (DVD) / Macworld Resource DVD May 2003.toast / Data / Software / Bonus / Database / mysql-max-3.23.55.sit / mysql-max-3.23.55-apple-darwi.1 / mysql-test / t / rpl000001.test < prev    next >
Encoding:
Text File  |  2003-01-21  |  2.1 KB  |  93 lines  |  [TEXT/ttxt]

  1. source include/master-slave.inc;
  2. connection master;
  3. use test;
  4. drop table if exists t1,t3;
  5. create table t1 (word char(20) not null);
  6. load data infile '../../std_data/words.dat' into table t1;
  7. set password = password('foo');
  8. set password = password('');
  9. create table t3(n int);
  10. insert into t3 values(1),(2);
  11. save_master_pos;
  12. connection slave;
  13. sync_with_master;
  14. use test;
  15. select * from t3;
  16. select sum(length(word)) from t1;
  17. connection master;
  18. drop table t1,t3;
  19. save_master_pos;
  20. connection slave;
  21. sync_with_master;
  22.  
  23. #test handling of aborted connection in the middle of update
  24. connection master;
  25. reset master;
  26. connection slave;
  27. reset slave;
  28.  
  29. connection master;
  30. drop table if exists t1,t2;
  31. create table t1(n int);
  32. let $1=10;
  33. while ($1)
  34. {
  35.  eval insert into t1 values($1);
  36.  dec $1;
  37. }
  38. create table t2(id int);
  39. insert into t2 values(connection_id());
  40. save_master_pos;
  41.  
  42. connection master1;
  43. #avoid generating result
  44. create temporary table t1_temp(n int);
  45. insert into t1_temp select get_lock('crash_lock%20C', 1) from t2;
  46.  
  47. connection master;
  48. send update t1 set n = n + get_lock('crash_lock%20C', 2);
  49. connection master1;
  50. sleep 2;
  51. select (@id := id) - id from t2;
  52. kill @id;
  53. drop table t2;
  54. connection master;
  55. --error 1053;
  56. reap;
  57. connection slave;
  58. sync_with_master ;
  59. #give the slave a chance to exit
  60. sleep 2;
  61.  
  62. # The following test can't be done because the result of Pos will differ
  63. # on different computers
  64. # --replace_result 9306 9999 3334 9999 3335 9999
  65. # show slave status;
  66.  
  67. set sql_slave_skip_counter=1;
  68. slave start;
  69. select count(*) from t1;
  70. connection master1;
  71. drop table t1;
  72. create table t1 (n int);
  73. insert into t1 values(3456);
  74. use mysql;
  75. insert into user (Host, User, Password)
  76.  VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
  77. select select_priv,user from mysql.user where user = 'blafasel2';
  78. update user set Select_priv = "Y" where User="blafasel2";
  79. select select_priv,user from mysql.user where user = 'blafasel2';
  80. use test;
  81. save_master_pos;
  82. connection slave;
  83. sync_with_master;
  84. select n from t1;
  85. select select_priv,user from mysql.user where user = 'blafasel2';
  86. connection master1;
  87. drop table t1;
  88. save_master_pos;
  89. connection slave;
  90. sync_with_master;
  91.  
  92.  
  93.